#include "labeldialog.h"
#include <QVBoxLayout>
#include <QLabel>
#include <QComboBox>
#include <QLineEdit>
#include <QDialogButtonBox>
LabelDialog::LabelDialog(QWidget *parent)
    : QDialog(parent)
{
    setWindowTitle("Select Category");
    QVBoxLayout *layout = new QVBoxLayout(this);

    QLabel *label = new QLabel("Choose a category:");
    layout->addWidget(label);
    lineEdit = new QLineEdit();
    lineEdit->setPlaceholderText("Enter label name here...");
    layout->addWidget(lineEdit);

    QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
    connect(buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
    connect(buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
    layout->addWidget(buttons);
}

QString LabelDialog::labelName() const {
    return lineEdit->text();
}
